/**
 * Copyright © 2013 Creativor Studio.
 * About license information, please see LICENSE.txt.
 */
package org.rayson.server.http;

import org.rayson.share.http.HttpAbstractMessage;
import org.rayson.share.http.HttpConstants;
import org.rayson.share.http.HttpHeader;
import org.rayson.share.http.HttpResponse;
import org.rayson.share.http.HttpStatusLine;

/**
 * Server side {@link HttpResponse} object.
 * 
 * @author creativor
 */
public class HttpServerResponse extends HttpAbstractMessage<HttpStatusLine>
		implements HttpResponse {

	public HttpServerResponse() {
	}

	@Override
	public void setBody(final byte[] body) {
		addHeader(new HttpHeader(HttpConstants.CONTENT_LENGTH_HEADER_NAME,
				String.valueOf(body.length)));
		super.setBody(body);
	}
}
